// ListeningExercise.less
@primary: #1EB7D8;
@vocabulary: #5A9E60;
@success: #4CAF50;
@error: #F44336;

.word-header {
  padding: 5px 20px;
  background: #f8f9ff;
  display: flex;
  justify-content: space-between;

}

.word-section {
  padding: 5px 20px;
  background: #f8f9ff;
  text-align: center;
}

.word {
  font-size: 1rem;
  font-weight: bold;
  display: inline-flex;
  color: #5b9f60;
  background-color: #dbeadf;
  padding: 10px;
  border-radius: 20px;
}

.word-display {
  display: inline-flex;
  align-items: center;
  padding: 15px 20px;
  border-radius: 50px;
  font-size: 2rem;
  font-weight: bold;
  color: var(--text-color);
  margin: 0 20px;
}

.word-display:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  background: #e6f7ff;
}

  .celebration-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1000;
    display: none;

    .confetti {
      position: absolute;
      width: 16px;
      height: 16px;
      animation: confetti 5s ease-in-out forwards;

      @keyframes confetti {
        0% { transform: translateY(0) rotate(0deg); opacity: 1; }
        100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
      }
    }
  }

  // 顶部导航
  .top-gradient.header {
    background: linear-gradient(135deg, #D4E9FC 0%, #B9DEF7 100%);
    padding: 16px;

    .header-content {
      display: flex;
      justify-content: space-between;
      align-items: center;

      .back-btn {
        width: 40px;
        height: 40px;
        background: white;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        transition: all 0.2s ease;

        &:active {
          transform: scale(0.95);
        }

        .fa {
          color: @primary;
          font-size: 18px;
        }
      }

      .unit-header {
        background-color: rgba(90, 158, 96, 0.2);
        color: #38703C;
        font-weight: bold;
        padding: 8px 16px;
        border-radius: 20px;
        font-size: 14px;
      }

      .placeholder {
        width: 40px;
      }
    }
  }

  // 主要内容
  .main-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    padding-bottom: 80px;
    display: flex;
    flex-direction: column;

    .progress-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 16px;

      .word-number {
        font-size: 14px;
        background-color: fade(@vocabulary, 20%);
        color: @vocabulary;
        padding: 6px 12px;
        border-radius: 20px;
        font-weight: 500;
      }

      .recognition-status {
        font-size: 12px;
        color: #666;
      }
    }

    .exercise-content {
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 24px;

      .instruction-text {
        color: #666;
        font-size: 14px;
        font-weight: 500;
        text-align: center;
        margin-bottom: 8px;
      }

      // 单词和播放区域
      .word-audio-container {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 16px;
        background: white;
        padding: 16px;
        border-radius: 16px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        animation: popIn 0.3s ease-out;

        &.pop-in {
          animation: popIn 0.3s ease-out;
        }

        @keyframes popIn {
          0% { transform: scale(0.8); opacity: 0; }
          70% { transform: scale(1.1); }
          100% { transform: scale(1); opacity: 1; }
        }

        .word-card {
          text-align: center;

          .current-word {
            font-size: 32px;
            font-weight: bold;
            color: @vocabulary;
            margin: 0;
          }
        }

        .play-btn {
          width: 64px;
          height: 64px;
          background: @primary;
          color: white;
          border-radius: 50%;
          display: flex;
          align-items: center;
          justify-content: center;
          box-shadow: 0 4px 12px rgba(30, 183, 216, 0.3);
          transition: all 0.3s ease;

          &:active {
            transform: scale(0.95);
          }

          .fa {
            font-size: 24px;
          }


          @keyframes pulse {
            0% { transform: scale(1); }
            50% { transform: scale(1.05); }
            100% { transform: scale(1); }
          }
        }
        .pulse-animation {
            width: 64px;
            height: 64px;
            background: @primary;
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 12px rgba(30, 183, 216, 0.3);
            transition: all 0.3s ease;
            animation: pulse 0.8s ease-in-out;
          }
      }

      // 录音区域
      .recording-section {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 16px;

        .mic-btn {
          width: 80px;
          height: 80px;
          background: @success;
          color: white;
          border-radius: 50%;
          display: flex;
          align-items: center;
          justify-content: center;
          box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
          transition: all 0.3s ease;

          &:active {
            transform: scale(0.95);
          }

          .fa {
            font-size: 32px;
          }

          &.recording {
            background: @error;
            animation: micPulse 1.2s infinite;
          }

          @keyframes micPulse {
            0% { box-shadow: 0 0 0 0 rgba(244, 67, 54, 0.4); }
            70% { box-shadow: 0 0 0 10px rgba(244, 67, 54, 0); }
            100% { box-shadow: 0 0 0 0 rgba(244, 67, 54, 0); }
          }
        }

        .mic-btn-recording {
          width: 80px;
          height: 80px;
          background: @success;
          color: white;
          border-radius: 50%;
          display: flex;
          align-items: center;
          justify-content: center;
          box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
          transition: all 0.3s ease;
          background: @error;
          animation: micPulse 1.2s infinite; 
        }

        .recording-hint {
          color: #666;
          font-size: 12px;
          text-align: center;
          max-width: 200px;
        }
      }
    }

    // 底部操作按钮
    .action-btn {
      position: fixed;
      bottom: 15px;
      left: 15px;
      right: 15px;
      z-index: 10;
      height: 48px;
      border-radius: 24px;
      font-weight: bold;
      font-size: 16px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
      transition: all 0.3s ease;

      &:active {
        transform: scale(0.98);
      }

      &.disabled {
        opacity: 0.7;
        cursor: not-allowed;
      }

      &.vocabulary {
        background: @vocabulary;
        color: white;
      }

      &.success {
        background: @success;
        color: white;
      }

      &.error {
        background: @error;
        color: white;
      }
    }
  }

  // 反馈弹窗
  .feedback-modal {
    .adm-modal-content {
      border-radius: 24px 24px 0 0;
    }

    .feedback-content {
      padding: 24px;

      .feedback-body {
        text-align: center;

        .feedback-icon {
          width: 64px;
          height: 64px;
          border-radius: 50%;
          display: flex;
          align-items: center;
          justify-content: center;
          margin: 0 auto 16px;

          .fa {
            font-size: 24px;
          }

          &.success {
            background-color: fade(@success, 20%);
            .fa { color: @success; }
          }

          &.error {
            background-color: fade(@error, 20%);
            .fa { color: @error; }
          }
        }

        .feedback-title {
          font-size: 20px;
          font-weight: bold;
          margin-bottom: 8px;

          &.success {
            color: @success;
          }

          &.error {
            color: @error;
          }
        }

        .feedback-message {
          color: #666;
          margin-bottom: 16px;
          line-height: 1.4;
        }

        .pronunciation-comparison {
          display: flex;
          flex-direction: column;
          gap: 8px;
          margin-bottom: 24px;

          .pronunciation-item {
            font-size: 14px;
            background: #f5f5f5;
            padding: 8px 16px;
            border-radius: 20px;

            .standard {
              font-weight: bold;
              color: @primary;
            }

            .user {
              font-weight: bold;

              &.success {
                color: @success;
              }

              &.error {
                color: @error;
              }
            }
          }
        }
      }
    }

    .adm-modal-footer {
      padding: 0;

      .adm-modal-button {
        height: 48px;
        border-radius: 24px;
        font-weight: bold;

        &.success-btn {
          background: @success;
          color: white;
        }

        &.error-btn {
          background: @error;
          color: white;
        }
      }
    }
  }
  // 所有单词弹窗
  .list-modal {
  max-width: 400px;
  max-height: 80vh;
  padding: 25px 20px 8px;
  --border-radius: 24px;
}
.list-content {
  .list-title {
    text-align: center;
    font-weight: 700;
    font-size: 1.25rem;
    line-height: 1.75rem;
  }

  .header-title {
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.25rem;
  }

  .word-list {
    margin-top: 15px;

    .word-item {
      padding: 12px 15px;
      border-radius: 12px;
      margin-bottom: 8px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      cursor: pointer;
      border: 1px solid #f0f0f0;
    }

    .word-item-current {
      padding: 12px 15px;
      border-radius: 12px;
      margin-bottom: 8px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      cursor: pointer;
      border: 1px solid #f0f0f0;
      background-color: #5a9e6033;
      border-color: #5a9e604d;
    }

    .word-inco {
      color: #ddd;
    }

    .word-inco-current {
      color: #1EB7D8;
    }


  }

  .close-button {
    display: block;
    margin: 1.5rem auto 0;
    border-radius: 9999px;
    background-color: #f3f4f6;
    font-weight: 700;

  }
}
.actions {
  padding: 0 20px 20px;
}

.continue-button {
  height: 50px;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 20px;
  background: #8cbb90;
  //background: linear-gradient(to right, rgb(41 155 89), rgb(69 123 92));
  //background: linear-gradient(to bottom, rgb(207 255 234), rgb(241 255 248));
  border: none;
  color: #ffffff;
  box-shadow: 0 4px 8px rgba(255, 126, 95, 0.3);
  transition: all 0.3s ease;
}
.continue-button:disabled {
  background: #f0f0f0;
  color: #bfbfbf;
  box-shadow: none;
  cursor: not-allowed;
}

.continue-button:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(255, 126, 95, 0.4);
}
// 响应式设计
@media (max-width: 640px) {
  .listening-exercise {
    .main-content {
      .exercise-content {
        .word-audio-container {
          flex-direction: row !important;
          padding: 12px !important;

          .current-word {
            font-size: 28px !important;
            white-space: nowrap;
          }

          .play-btn {
            width: 60px !important;
            height: 60px !important;

            .fa {
              font-size: 20px !important;
            }
          }
        }

        .recording-section {
          .mic-btn {
            width: 80px !important;
            height: 80px !important;

            .fa {
              font-size: 28px !important;
            }
          }
        }
      }

      .action-btn {
        font-size: 14px !important;
      }
    }
  }
}